<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" >
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">创建停车场信息</h4>
    </div>

      <form class="form-horizontal ms-form modal-search-form" role="form" method="POST" data-validate="true" action="${ctx.host}/suppliers/${supplierId}/parking-resource"
            data-validate="true" data-anchor="#anchor-parking-resource">
            
        <div class="modal-body">
          
          <input type="hidden" name="supplier" value="${supplierId}" />

          <div class="form-horizontal ms-form form-personal-info">
      
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-4 ">1&nbsp;<span class="color-red">*</span>位置：</label>
              <div class="col-xs-7 pull-left">
                <input type="text" name="position" class="form-control" value="" data-validate="required" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
            </div>
            
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-4 ">2&nbsp;<span class="color-red">*</span>面积(平方)：</label>
              <div class="col-xs-7 pull-left">
                <input type="text" name="area" class="form-control" value="" data-validate="number" data-validate="required" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
            </div>
    
            <div class="form-group  ms-form-group">
              <label class="control-label col-xs-4" >3&nbsp;<span class="color-red">*</span>场地来源：</label>
              <div class="col-xs-7 pull-left">
                <select class="select2 form-control" name="fieldSource"  data-validate="required" tabindex="1">
                  <option></option>
                  <c:forEach var="fieldSource" items="${enums['FieldSource'] }">
                    <option value="${fieldSource}">${fieldSource.description}</option>
                  </c:forEach>
                </select>
              </div>
            </div>
            
            <div class="form-group  ms-form-group">
              <label class="control-label col-xs-4">4&nbsp;到期日期：</label>
              <div class="col-xs-7 pull-left">
                <input type="text" name="expireDate" class="form-control date" value="" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
            </div>
    
        </div>
        </div>

        <div class="modal-footer">
            <button type="submit" class="btn ms-btn btn-primary">确定</button>
            <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
        </div>

          </form>
      
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('select[name="fieldSource"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });
        
        $('.date').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            language: 'zh-CN',
            todayBtn: 'linked',
            startDate: '${today}',
            todayHighlight: true,
            pickerPosition: 'bottom-right',
            minView: 'month'
          });
    })
</script>
